/**
 * @Author：ming
 * @Date：2023/10/29 8:55 PM
 * @Filename：Hot189
 */

import java.util.ArrayList;

/**
 * @author ming
 */
public class Hot189 {
    public void rotate(int[] nums, int k) {
        //向左移动
        int len = nums.length;
        int count = len - k%len;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = count; i < len; i++) {
            list.add(nums[i] );
        }

        for (int i = 0; i < count; i++) {
            list.add(nums[i] );
        }

        for (int i = 0; i < list.size(); i++) {
            nums[i]=list.get(i);
        }


    }
}
